1. Field of the Invention
The present invention relates to communication speed control apparatuses and communication speed control methods, and particularly relates to techniques for controlling the speed of data communication carried out between a host computer and an external device.
2. Description of Related Art
USB (Universal Serial Bus) has become common as a standard for connecting a host computer such as a personal computer or a navigation device to various types of peripheral devices serving as external devices and carrying out data communication. USB 2.0, for example, provides three types of communication speeds, which are, in order from the fastest to slowest, high-speed mode (called “HS mode” hereinafter), full-speed mode (called “FS mode” hereinafter), and low-speed mode (called “LS mode” hereinafter).
USB 2.0-compliant host computers (called “USB hosts” hereinafter) and USB 2.0-compliant external devices (called “USB devices” hereinafter) are capable of carrying out data communication using any of these three types of communication speeds. Generally, when a USB host detects a connection with a USB device, the bus is reset (that is, both the D+ and D− signal lines are set to low level) and a handshake process known as a “chirp” is carried out, thereby determining the communication speed. At this time, the communication speed is set to HS in the case where a USB device that is compliant with the HS mode has been connected, whereas the communication speed is set to FS in the case where a USB device that is compliant with the FS mode has been connected.
After the communication speed has been determined, the USB host obtains information necessary for resetting from the USB device and executes processes that enable the USB device to be used. The USB host and the USB device then exchange data. USB features four types of data transfer methods, i.e., control transfer, interrupt transfer, bulk transfer, and isochronous transfer.
Control transfer is a transfer method for carrying out the basic control of the USB device, and is used when recognizing the USB device and so on. Interrupt transfer is a method for transferring data of a small size in a cyclic manner, and is primarily used when communicating with a USB device such as a mouse or a keyboard. Bulk transfer is a method for transferring large amounts of data, and is primarily used when exchanging data with a storage device such as a hard disk. Isochronous transfer is a method for transferring data in real time, and is primarily used when streaming audio data, video data, and so on.
Note that in the normal USB 2.0 specifications, when an HS mode or FS mode USB device is recognized by the USB host, the communication speed is not changed until a reset is carried out or the device is reconnected. However, techniques that enable the modes to be changed between the HS mode and the FS mode have been proposed (for example, see JP-2006-330831A, JP-2005-327247A, JP-2005-182380A, and JP-2007-172160A).
JP-2006-330831A discloses toggling between HS mode and FS mode in accordance with the amount of data to be transferred, the remaining battery charge of a mobile electronic device, and so on. JP-2005-327247A discloses toggling the communication speed by a user operating a toggle switch. JP-2005-182380A, meanwhile, discloses prohibiting HS mode in the case where the communication error rate is greater than or equal to a predetermined value. Finally, JP-2007-172160A discloses switching from HS mode to FS mode in the case where a poor communication state, in which the quality of communication has dropped, has continued for a set amount of time.
In addition, a technique has been disclosed in which model specification information of incompatible USB memories, for which communication errors can be foreseen, is stored in advance in a storage unit in a USB host, and when the USB host has detected a connection with a USB memory, the USB host obtains the model specification information stored in the USB memory and carries out a warning operation in the case where it has been determined that model specification information that matches the obtained model specification information is stored in the storage unit (for example, see JP-2009-193358A).
When a USB device that has poor compatibility with a USB host is connected to the USB host, and HS mode is set, the waveform of the data being communicated may degrade, leading to the communication errors. In the case where data communication is carried out using the control transfer method, the interrupt transfer method, or the bulk transfer method, a retry is executed through hardware when a communication error has been detected, thus making it possible to once again execute the same data communication.
Meanwhile, because isochronous transfer, which is carried out when streaming audio, video, or the like, is a real-time transfer method, it is not possible to execute a retry when a communication error has occurred. Accordingly, there has been a problem in that when a communication error has occurred, the data at the location of the communication error is lost, which leads to audio dropouts, video dropouts, and the like.
If the techniques disclosed in JP-2005-182380A and JP-2007-172160A are used in response to this problem, switching the communication speed from HS mode to FS mode in the case where the error rate is greater than or equal to a predetermined value or a poor communication state has continued for a set amount of time makes it possible to increase the communication quality and prevent data loss.
However, with the techniques disclosed in JP-2005-182380A and JP-2007-172160A, a state of poor communication quality has continued up until the communication speed has been switched from HS mode to FS mode, and thus communication errors occur. For this reason, data loss will occur in the case where a communication error has occurred during isochronous transfer, and thus the problem of audio dropouts and video dropouts cannot be eliminated.
Finally, with the technique disclosed in JP-2009-193358A, a warning is carried out as soon as an incompatible USB memory, for which the occurrence of communication errors can be foreseen, is connected to the USB host. However, even if such a warning is carried out, the communication speed is set to HS mode in the case where an HS mode-compliant USB device has been connected; errors will therefore occur during actual communication. For this reason, data loss will occur in the case where a communication error has occurred during isochronous transfer, and thus the problem of audio dropouts and video dropouts cannot be eliminated.
Having been conceived in order to solve the aforementioned problems, it is an object of the present invention to prevent data loss caused by communication errors in HS mode when carrying out data communication between a host computer and an external device.